package com.flash.DayProcessing.service.impl;

import com.flash.DayProcessing.entity.AccountValue;
import com.flash.DayProcessing.mapper.AccountValueMapper;
import com.flash.DayProcessing.service.AccountValueSerice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 这是现金模块的实现类
 * @author Liy
 * @since 2022-9-1
 * @version 1.0
 */
@Service
@Transactional
public class AccountValueServiceImpl implements AccountValueSerice {
    @Autowired
    AccountValueMapper accountValueMapper;

    /**
     * 通过日期、id、类型来连表查询数据
     * @param statisticsDate 日期
     * @param fundId 基金id
     * @param type 业务类型
     * @return 现金模块
     */
    @Override
    public List<AccountValue> selectAccountValue(String statisticsDate, String fundId, int type) {
        return accountValueMapper.selectAccountValue(statisticsDate,fundId,type);
    }

    /**
     * 现金模块查询方法-TA清算款
     * @param cashId 账户id
     * @param businessType 业务类型
     * @param businessState 流入流出
     * @param statisticsDate 日期
     * @param fundId 基金id
     * @return 现金模块
     */
    @Override
    public List<AccountValue> selectAccountTa(String cashId, int businessType, int businessState, String statisticsDate, String fundId) {
        return accountValueMapper.selectAccountTa(cashId,businessType,businessState,statisticsDate,fundId);
    }


    /**
     * 运营模块查询方法-两费
     * @param cashId 账户id
     * @param businessType 业务类型
     * @param statisticsDate 日期
     * @param fundId 基金id
     * @return 现金模块
     */
    @Override
    public List<AccountValue> selectOperationCost(String cashId, String statisticsDate, String fundId, int businessType) {
        return accountValueMapper.selectOperationCost(cashId,statisticsDate,fundId,businessType);
    }
}
